package Homeworks.HOMEWORK0307.BANK;

public class Bank {
    static String bankName;
    private String name;
    private String password;
    private double balance;
    private double turnover;

    public static void welcome(){
        System.out.println("欢迎来到"+bankName+"----------");
    }
    public Bank(String name,String password,double turnover){
        this.name=name;
        this.password=password;
        this.balance=turnover;
        System.out.println("开户成功，当前余额"+turnover);
    }

    public void deposit(double turnover){
        balance=balance+turnover;
        System.out.println(name+"你的账户已经存入"+turnover+"元，" +
                "当前余额"+balance);
    }
    public void withdrawal (String password,double turnover){
        if(this.password!=password){
            System.out.println("密码错误");
            return;
        }

         if(this.balance<turnover){
             System.out.println("余额不足");
         }else{
             System.out.println("已经取出"+turnover+"元" +
                     "，当前余额"+balance+"元");
         }


    }
    static void welcomeNext(){
        System.out.println("欢迎下次光临");
    }
}
